<?php



class Model extends Object
{
	/** @var DibiConnection */
	private $db;



	public function __construct()
	{
		$this->db = new DibiConnection(array(
		    'driver'   => 'mysql',
		    'host'     => 'localhost',
		    'username' => 'baki',
		    'password' => 'alfa',
		    'database' => 'broucekfm',
		    'charset'  => 'utf8',
			'profiler' => TRUE,
		));
	}



    /**
     * @return array
     */
	public function getTableNames()
	{
		return $this->db->getDatabaseInfo()->getTableNames();
	}



    /**
     * @return DibiDataSource
     */
	public function getDataSource($table)
	{
		return $this->db->dataSource('SELECT * FROM %n', $table);
	}

}